package cn.buaa.anniversary.helper;

import java.awt.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created this one by HMH on 2017/5/12.
 */
public class FontHelper {
    public static List<String> getAllAvaliableFont() {
        GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Font[] fonts = e.getAllFonts();
        List<String> result = new ArrayList<>();
        Arrays.stream(fonts).forEach(f -> result.add(f.getFontName()));
        return result;
    }
}
